package com.example.wastewater.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.wastewater.dao.entity.WastewaterDO;
import com.example.wastewater.dao.entity.WaterDataPreditDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface WaterDataPreditMapper extends BaseMapper<WaterDataPreditDO> {
    @Select("SELECT orgin_id, biological_oxygen_demand_predit, updated_at " +
            "FROM tb_water_data_predit " +
            "WHERE del_flag = 0 " +
            "ORDER BY updated_at DESC " +
            "LIMIT #{count}")
    List<WaterDataPreditDO> selectNewData(@Param("count") Integer count);

    @Select("Select biological_oxygen_demand_predit " +
            "from tb_water_data_predit " +
            "where orgin_id = #{orginId} " +
            "and del_flag = 0 " +
            "limit 1")
    Integer selectBODbyOrginId(@Param("orginId") Long orginId);
}
